package com.hhh.Util;


//往线程里面添加和删除Session里面记录的updateUser的id
public class GetThreadNow {

    //    添加id
    private static ThreadLocal<Long> threadLocal = new ThreadLocal<>();

    public static void SetIdInSession(long id) {
        threadLocal.set(id);
    }

    //获取线程里面的id
    public static long GetIdInSession() {
        return threadLocal.get();
    }

//        关闭线程，不关闭会造成内存泄露
    public static void CloseThread() {
        threadLocal.remove();
    }
}
